package com.ad.admin.androidadapt;

import android.app.ListActivity;
import android.os.Bundle;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by 39466 on 2016/3/23.
 */
public class NewListActivity extends ListActivity{

    private List<News> data=new ArrayList<News>();
    private void init(){
        News new1= new News("T1","c1",R.drawable.a);
        News new2= new News("T2","c2",R.drawable.b);
        News new3= new News("T3","c3",R.drawable.c);
        data.add(new1);data.add(new2);data.add(new3);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init();
        MyAdapter myAdapter = new MyAdapter(this,data);
        setListAdapter(myAdapter);
    }
}
